/**
 * Created by 14229 on 2020/2/27.
 */
public class Test07 {
    public static void main(String[] args) {
        int count = 0;
        String s = "sshelloworldhellojavahellojsp";
        char[] chars = s.toCharArray();
        for (int i = 0; i <chars.length ; i++) {
            if (chars[i]=='h'){
                if (chars[i+1]=='e' && chars[i+2]=='l' && chars[i+3]=='l' && chars[i+4]=='o'){
                    count++;
                    System.out.println("index="+i);
                }
            }
        }
        System.out.println("count="+count);
    }
}
